<template>
  <view class="demo-container">
    <!-- 基础用法 -->
    <view class="demo-block">
      <view class="demo-block__title">基础用法</view>
      <view class="demo-block__content">
        <fu-steps :active="active1">
          <fu-step title="步骤1" desc="这是步骤1的描述信息" />
          <fu-step title="步骤2" desc="这是步骤2的描述信息" />
          <fu-step title="步骤3" desc="这是步骤3的描述信息" />
        </fu-steps>
        <view class="demo-buttons">
          <fu-button size="small" @click.native="prevStep">上一步</fu-button>
          <fu-button size="small" type="primary" @click.native="nextStep">下一步</fu-button>
        </view>
      </view>
    </view>
    
    <!-- 自定义颜色 -->
    <view class="demo-block">
      <view class="demo-block__title">自定义颜色</view>
      <view class="demo-block__content">
        <fu-steps 
          :active="1"
          active-color="#ee0a24"
          inactive-color="#969799"
        >
          <fu-step title="步骤1" desc="这是步骤1的描述信息" />
          <fu-step title="步骤2" desc="这是步骤2的描述信息" />
          <fu-step title="步骤3" desc="这是步骤3的描述信息" />
        </fu-steps>
      </view>
    </view>
    
    <!-- 点状步骤条 -->
    <view class="demo-block">
      <view class="demo-block__title">点状步骤条</view>
      <view class="demo-block__content">
        <fu-steps :active="1" dot>
          <fu-step title="步骤1" desc="这是步骤1的描述信息" />
          <fu-step title="步骤2" desc="这是步骤2的描述信息" />
          <fu-step title="步骤3" desc="这是步骤3的描述信息" />
        </fu-steps>
      </view>
    </view>
    
    <!-- 垂直步骤条 -->
    <view class="demo-block">
      <view class="demo-block__title">垂直步骤条</view>
      <view class="demo-block__content">
        <fu-steps :active="1" direction="vertical">
          <fu-step title="步骤1" desc="这是步骤1的描述信息" />
          <fu-step title="步骤2" desc="这是步骤2的描述信息" />
          <fu-step title="步骤3" desc="这是步骤3的描述信息" />
        </fu-steps>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      active1: 0
    }
  },
  methods: {
    prevStep() {
      console.log('prev', this.active1)
      if (this.active1 > 0) {
        this.active1--
      }
    },
    nextStep() {
      console.log('next', this.active1)
      if (this.active1 < 2) {
        this.active1++
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.demo-container {
  padding: 20rpx;
}

.demo-block {
  margin-bottom: 30rpx;
  
  &__title {
    margin-bottom: 20rpx;
    font-size: var(--fu-font-size-lg);
    color: var(--fu-text-color);
  }
  
  &__content {
    background-color: #fff;
    border-radius: var(--fu-radius-base);
    padding: 30rpx;
  }
}

.demo-buttons {
  margin-top: 30rpx;
  display: flex;
  gap: 20rpx;
  justify-content: center;
}
</style> 